import Vue from "vue";
import VueRouter from "vue-router";
import HomeView from "@/views/index.vue"
import Policy from '@/views/policy' 
import nationalKnowledge from '@/views/nationalKonwlefge'
import inform from '@/views/inform'
import first from '@/views/first'
import logistical from '@/views/logistical'
import userCenter from '@/views/userCenter'
import retirement from '@/views/retirement'
import desc from '@/views/desc'
import login from '@/views/login'
import register from '@/views/register'
Vue.use(VueRouter);

const routes = [
  {
    path:'/',
    name:'login',
    component:login
  },
  {
    path:'/register',
    name:'register',
    component:register
  },
  {
    path: "/index",
    name: "home",
    component: HomeView,
    children:[
      //子路由
      {path:'/index',component:first},
      {path:'page1',component:Policy},
      {path:'page2',component:nationalKnowledge},
      {path:'page3',component:inform},
      {path:'page4',component:first},
      {path:'page5',component:logistical},
      {path:'page6',component:retirement},
      {path:'page7',component:userCenter},
      {path:'page8',name:'page8',component:desc}
    
  ]
  },
 
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;
